package com.deyuanyun.pic.ctrl.enumeration;

import com.deyuanyun.pic.ctrl.domain.*;

/**
 *
 * @author lijun
 * @date 2016-09-07
 * 设备阴保电源运行状态
 * History: [修改人][时间][修改描述]
 */
public enum EqptTypeEnum {
    CPPOWER("阴保电源", EqptCppowerr.class),
    REFERENCE("长效参比",EqptReference.class),
    ANODESBED("阳极地床", EqptAnodesbed.class),
    INSULATEDJOINT("绝缘装置",EqptInsulatedJoint.class),
    ANTISURGE("防浪涌保护器", EqptAntiSurge.class),
    CPJUMPER("跨接线", EqptCpJumper.class),
    CPTESTSTATION("阴保测试桩",EqptCptestStation.class),
    SAALANODE("牺牲阳极", EqptSaalAnode.class),
    CURRENTDRAINAGE("排流装置",EqptCurrentDrainage.class);


    private String label;
    private Class clazz;


    private EqptTypeEnum(String label,Class clazz) {
        this.label = label;
        this.clazz = clazz;
    }

    public String getLabel() {
        return label;
    }

    public Class  getClazz(){return clazz;}

    public static EqptTypeEnum getValueByLabel(String label){
        EqptTypeEnum[] eptTypeConstants = EqptTypeEnum.values();
        for(EqptTypeEnum  enumItem:eptTypeConstants){
            if(enumItem.getLabel().equals(label)){
                return enumItem;
            }
        }
        return null;
    }
    public static EqptTypeEnum getInstance(String str) {
        EqptTypeEnum[] eqptTypeEnum = EqptTypeEnum.values();
        for (EqptTypeEnum recodeExprotEnum : eqptTypeEnum) {
            String name = recodeExprotEnum.name();
            if(name.equals(str)) {
                return recodeExprotEnum;
            }
        }
        return null;
    }

}
